package com.kaibes.platform.article.listener;

import org.springframework.beans.factory.annotation.Autowired;

import com.kaibes.orm.core.listener.DeleteListener;
import com.kaibes.orm.curd.Delete;
import com.kaibes.orm.spring.OrmListener;
import com.kaibes.platform.article.db.service.ArticleCommentService;
import com.kaibes.platform.article.db.service.ArticleService;

@OrmListener(service = ArticleService.class)
public class ArticleDeleteListener implements DeleteListener {

    @Autowired
    private ArticleCommentService articleCommentService;
    
    @Override
    public void afterDelete(Delete delete, int count) throws Exception {
        articleCommentService.clearCache();
    }
    
}
